import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store, { setupStore } from './store'
import pxRequest from './service'

//全局引入
import { globalRegister } from './global'
import 'normalize.css'
import './assets/css/index.less'

const app = createApp(App)

//直接写成调用函数也是可以的
globalRegister(app)
//app.use传入一个函数的话，默认会把app对象传给这个函数
//app.use(globalRegister)
app.use(store)
setupStore()
app.use(router)
app.mount('#app')

// interface DataType {
//   data: any
//   returnCode: string
//   success: boolean
// }

// pxRequest
//   .get<DataType>({
//     url: '/home/multidata',
//     showLoading: true
//   })
//   .then((res) => {
//     console.log(res)
//   })
